package insertpackage;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javabean.Files;

public class Insertfil extends Insert{
	public void insertDB(Files files){
        Connection conn = null;
        PreparedStatement pstmt = null;
        
        try {
            conn = getConnection();
            
            pstmt = conn.prepareStatement("insert into FILE values (?,?,?,?,?,?)");
            pstmt.setInt(1, 0);
            pstmt.setString(2, files.getFilNAME());
            pstmt.setString(3, files.getFilDATE());
            pstmt.setInt(4, files.getFilSIZE());
            pstmt.setString(5, files.getEmpID());
            pstmt.setInt(6, files.getProNO());
            
            pstmt.executeUpdate();
        } catch(SQLException ex) {
            //throw Except("insertProject", ex);
        } finally {
            if (pstmt != null) try { pstmt.close(); } catch(SQLException ex) {}
            if (conn != null) try { conn.close(); } catch(SQLException ex) {}
        }
    }
}